What is son of a gun meaning?

The phrase "son of a gun" is an informal expression used to describe someone who is shrewd, clever, or cunning. The origin of the term has several theories, but one popular explanation is that it originated in the early days of sailing when women were sometimes allowed aboard ships. When a baby was born during a voyage, the child might be placed on a gun carriage. Hence, the term "son of a gun" referred to a child born at sea. Over time, the phrase evolved to mean a person who was confident, bold, or sly. Today, it is often used as an exclamation of surprise or astonishment.